﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sio.Mdm.Server;

namespace IDM.BF.TestService
{
    [Sio.Mdm.Server.Service(Name = "ServiceWithCallToOtherService", DefaultInterface = typeof(ICallOtherService))]
    public class CallOtherService : BaseService, ICallOtherService, IRequireServerInstance
    {
        #region IServiceWithCallToOtherService Members

        public string CallOther()
        {   
            IHelloWorldService helloWorld = 
                (IHelloWorldService) Server.GetService(typeof(IHelloWorldService));
            
            return helloWorld.SayHello("Jure");
        }

        #endregion

        #region IRequireServerInstance Members
        
        private IServer _server;
        public new IServer Server
        {
            get
            {
                return _server;
            }
            set 
            {
                _server = value;
            }
        }
        #endregion
    }
}
